<template>
  <div class="">
    <el-container>
      <el-header>
        <div class="top">
          <span class="el-icon-user">积云会员系统</span>
          <span>{{ this.$store.state.user }} <button @click="exit">退出登录</button></span>
        </div>
      </el-header>
      <el-container>
        <el-aside width="200px">
          <el-menu
            default-active="2"
            class="el-menu-vertical-demo"
            background-color="#545c64"
            text-color="#fff"
            router
            active-text-color="#ffd04b"
          >
            <el-menu-item index="/home">
              <i class="el-icon-menu"></i>
              <span slot="title">首页</span>
            </el-menu-item>
            <el-menu-item index="/about">
              <i class="el-icon-document"></i>
              <span slot="title">会员管理</span>
            </el-menu-item>
            <el-menu-item index="/supplier">
              <i class="el-icon-setting"></i>
              <span slot="title">供应商管理</span>
            </el-menu-item>
             <el-menu-item index="/commodity">
              <i class="el-icon-document"></i>
              <span slot="title">商品管理</span>
            </el-menu-item>
             <el-menu-item index="/staff">
              <i class="el-icon-document"></i>
              <span slot="title">员工管理</span>
            </el-menu-item>
          </el-menu>
        </el-aside>
        <el-main>
            <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  mounted() {},
  methods: {
      exit(){
          this.$store.commit("exit")
          this.$router.push("/login")
      }
  },
};
</script>

<style lang='scss' scoped>
.el-header,
.el-footer {
  background-color: #2D3A4B;
  color: #333;
  text-align: center;
  line-height: 60px;
}
.top {
  width: 100%;
  display: flex;
  justify-items: center;
  justify-content: space-between;
  span {
    height: 60px;
    line-height: 60px;
    display: inline-block;
    margin: 0 30px;
    color: white;
  }
}
.el-menu{
    height: 100%;
    background: rgb(84,91,100);
}
.el-main{
    padding: 0px !important;
}
</style>
